package com.uhylab.uhuvinetest.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.uhylab.uhuvinetest.dao.UserDataEntity;
import com.uhylab.uhuvinetest.dao.LocalHistory;
import com.uhylab.uhuvinetest.dao.CloudHistory;
import com.uhylab.uhuvinetest.dao.UserDisHistoryEntity;

import com.uhylab.uhuvinetest.dao.UserDataEntityDao;
import com.uhylab.uhuvinetest.dao.LocalHistoryDao;
import com.uhylab.uhuvinetest.dao.CloudHistoryDao;
import com.uhylab.uhuvinetest.dao.UserDisHistoryEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDataEntityDaoConfig;
    private final DaoConfig localHistoryDaoConfig;
    private final DaoConfig cloudHistoryDaoConfig;
    private final DaoConfig userDisHistoryEntityDaoConfig;

    private final UserDataEntityDao userDataEntityDao;
    private final LocalHistoryDao localHistoryDao;
    private final CloudHistoryDao cloudHistoryDao;
    private final UserDisHistoryEntityDao userDisHistoryEntityDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDataEntityDaoConfig = daoConfigMap.get(UserDataEntityDao.class).clone();
        userDataEntityDaoConfig.initIdentityScope(type);

        localHistoryDaoConfig = daoConfigMap.get(LocalHistoryDao.class).clone();
        localHistoryDaoConfig.initIdentityScope(type);

        cloudHistoryDaoConfig = daoConfigMap.get(CloudHistoryDao.class).clone();
        cloudHistoryDaoConfig.initIdentityScope(type);

        userDisHistoryEntityDaoConfig = daoConfigMap.get(UserDisHistoryEntityDao.class).clone();
        userDisHistoryEntityDaoConfig.initIdentityScope(type);

        userDataEntityDao = new UserDataEntityDao(userDataEntityDaoConfig, this);
        localHistoryDao = new LocalHistoryDao(localHistoryDaoConfig, this);
        cloudHistoryDao = new CloudHistoryDao(cloudHistoryDaoConfig, this);
        userDisHistoryEntityDao = new UserDisHistoryEntityDao(userDisHistoryEntityDaoConfig, this);

        registerDao(UserDataEntity.class, userDataEntityDao);
        registerDao(LocalHistory.class, localHistoryDao);
        registerDao(CloudHistory.class, cloudHistoryDao);
        registerDao(UserDisHistoryEntity.class, userDisHistoryEntityDao);
    }
    
    public void clear() {
        userDataEntityDaoConfig.getIdentityScope().clear();
        localHistoryDaoConfig.getIdentityScope().clear();
        cloudHistoryDaoConfig.getIdentityScope().clear();
        userDisHistoryEntityDaoConfig.getIdentityScope().clear();
    }

    public UserDataEntityDao getUserDataEntityDao() {
        return userDataEntityDao;
    }

    public LocalHistoryDao getLocalHistoryDao() {
        return localHistoryDao;
    }

    public CloudHistoryDao getCloudHistoryDao() {
        return cloudHistoryDao;
    }

    public UserDisHistoryEntityDao getUserDisHistoryEntityDao() {
        return userDisHistoryEntityDao;
    }

}
